Fix the backward compatibility support for using 'vcpus' in the image section of...
authorrread@ubuntu.eng.hq.xensource.com <rread@ubuntu.eng.hq.xensource.com>
Thu, 9 Feb 2006 02:20:51 +0000 (19:20 -0700)
committerrread@ubuntu.eng.hq.xensource.com <rread@ubuntu.eng.hq.xensource.com>
Thu, 9 Feb 2006 02:20:51 +0000 (19:20 -0700)
Signed-off-by: Robert Read <robert@xensource.com>
tools/python/xen/xend/XendDomainInfo.py

index 7c572dedbb2721b7ebf932f4f174e344678b5da1..5db26c1d4beb02baf927bb988e10360123229396 100644 (file)
@@ -294,7 +294,9 @@ def parseConfig(config):
     try:
         if result['image']:
             v = sxp.child_value(result['image'], 'vcpus')
-            if v is not None and int(v) != result['vcpus']:
+            if result['vcpus'] is None and v is not None:
+                result['vcpus'] = int(v)
+            elif v is not None and int(v) != result['vcpus']:
                 log.warn(('Image VCPUs setting overrides vcpus=%d elsewhere.'
                           '  Using %s VCPUs for VM %s.') %
                          (result['vcpus'], v, result['uuid']))